# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=openal-soft
pkgver=1.22.2
pkgrel=0
pkgdesc="software implementation of OpenAL API"
options="!check"
url="https://openal-soft.org/"
arch="all"
license="LGPL-2.0-or-later"
depends_dev="alsa-lib-dev pulseaudio-dev
jack-dev portaudio-dev sdl2-dev"
makedepends="$depends_dev linux-headers cmake qt5-qtbase-dev
zlib-dev ffmpeg-dev samurai"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/kcat/openal-soft/archive/$pkgver.tar.gz"

build() {
	local _cpuext_neon=
	case "$CARCH" in
		armhf) _cpuext_neon=-DALSOFT_CPUEXT_NEON=OFF;;
	esac
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		$_cpuext_neon
	ninja -C build
}

check() {
	ninja -C build test
}

package() {
	DESTDIR="$pkgdir" ninja -C build install
}

sha512sums="
2084c15254b047a7fb46f3e8e7cff92a71bbc702e2f356bb366b7ab3b7d03d917475ec5a6e50a88ac5204c6e9c12ab0d0370a88d563b4a5eb333365836489b7b  openal-soft-1.22.2.tar.gz
"
